import AsyncStorage from '@react-native-async-storage/async-storage';


export const setStorage = async (key:string, value:any) => {
    try {
      await AsyncStorage.setItem(key, JSON.stringify(value));
    } catch (error) {
      console.log(error);
    }
  };
  
  export const getStorage = async (key:string) => {
    try {
      const value:any = await AsyncStorage.getItem(key);
      return JSON.parse(value);
    } catch (error) {
      console.log(error);
    }
  };
  
  export const removeStorage = async (key:string) => {
    try {
      await AsyncStorage.removeItem(key);
    } catch (error) {
      console.log(error);
    }
  };
  
  export const clearStorage = async () => {
    try {
      await AsyncStorage.clear();
    } catch (error) {
      console.log(error);
    }
  };
  